package cn.etynit.mms.fallback;

import cn.etynit.domain.ExpenseMaintain;
import cn.etynit.exception.GlobalExceptionCodeEnum;
import cn.etynit.mms.feign.ExpenseMaintainService;
import cn.etynit.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ExpenseMaintainServiceFallbackFactory implements FallbackFactory<ExpenseMaintainService> {
    @Override
    public ExpenseMaintainService create(Throwable throwable) {
        return new ExpenseMaintainService() {
            @Override
            public JsonResult saveOrUpdate(ExpenseMaintain expenseMaintain) {
                return JsonResult.error(GlobalExceptionCodeEnum.ERROR);
            }
        };
    }
}
